package top.kaoshanji.ch03;

import com.google.inject.Inject;
import top.kaoshanji.ch03.beans.Agent;
import top.kaoshanji.ch03.beans.AgentFinder;

import java.util.List;

/**
 * 代码清单 ch03-04：用JSR-330 DI注入AgentFinder
 * 与HollywoodServiceV3相识度 98%，就是多了个注解
 * author kaoshanji
 * ^_^
 * create time 2024/12/14 17:04
 */
public class HollywoodServiceV4 {

    @Inject
    public static List<Agent> getFriendlyAgents(AgentFinder finder) {

        List<Agent> agents = finder.findAllAgents();
        return HollywoodFilter.filterAgents(agents, "Java Developers");

    }


}
